#-----------------------
# Let's do some matching
#-----------------------

# Set up
rm(list=ls())
setwd("C:/RWORKING/GAIN")
source("gaintools.R")

# Read our data, set our comprehensive output variable
data = as.matrix(read.table("C:/data/gain/gain-variables-smallset.txt", header=TRUE))
format = c("%6i", "%6i", "%6i", "%6i", "%6i", "%6i", "%6i", "%6i", "%6i", "%3.3d", "%3.3d", "%3.3d", "%3.3d", "%3.3d", "%3.3d", "%3.3d")
out = ""
line = ""

for(i in 1:nrow(data)) {
  line = sprintf(format, data[i,]);
  out = paste(c(out, line, "\n"), sep="", collapse=NULL)
}
write.table(out, file="gain-variables-smallset-fwf.txt", sep=" ", quote=FALSE, row.names=FALSE, col.names=FALSE)